package com.itheima.reflect.Demo;

import java.lang.reflect.Method;
import java.util.Properties;

@SuppressWarnings("all")
public class ReflectDemo5 {
    public static void main(String[] args) throws Exception {
        Properties prop = new Properties();
        prop.load(ReflectDemo5.class.getClassLoader().getResourceAsStream("prop.properties"));

        Class aClass = Class.forName(prop.getProperty("className"));
        Method method = aClass.getDeclaredMethod(prop.getProperty("methodName"));
        method.setAccessible(true);
        Object obj = aClass.newInstance();
        method.invoke(obj);
    }
}
